#ifndef _DATA_PROCESS_H
#define _DATA_PROCESS_H

#include "main.h"
#include "map_build.h"
#include "snake_define.h"


void* snake_move(void* arg);//让蛇自动行走的线程

class ServerData
{
public:
    ServerData(unsigned char score=0, unsigned char mvp=0, GameCmd cmd=NONE_CMD)
    {
        m_score = score;
        //m_cmd = cmd;
        m_mvp = mvp;
    }

    //void set_client_map(int start_x, int start_y);
    ClientMap &get_map()
    {
        return client_map;
    }
private:
    //PicCode m_part_map[CLIENT_ROW_CNT][CLIENT_COL_CNT];//地图代码消息
    ClientMap client_map;
    unsigned char m_score;//分数
    //GameCmd m_cmd;
    unsigned char m_mvp;
};


class ClientData
{
public:
    //void parse_data(Snake *snakep);
    void parse_data(Snake &snake);
private:
    GameCmd m_cmd;
    SnakeDir m_dir;  
};

void get_client_map_origin(const int head_x, const int head_y, int *start_x, int *start_y);
#endif